<template>
  <div id="contact">
    <el-table
        :data="tableData"
        border="false"
        :row-class-name="tableRowClassName">
        style="width: 100%">
      <el-table-column type="expand">
        <template v-slot="scope">
          <el-form label-position="left" inline class="demo-table-expand">
            <el-form-item label="商品名称">
              <span>{{ scope.row.name }}</span>
            </el-form-item>
          </el-form>
        </template>
      </el-table-column>

      <el-table-column
          label="时间"
          prop="id">
      </el-table-column>
      <el-table-column
          label="标的"
          prop="name">
      </el-table-column>
      <el-table-column
          label="操作"
          prop="desc">
      </el-table-column>

      <el-table-column
          label="大V"
          prop="desc">
      </el-table-column>

      <el-table-column
          label="详细"
          prop="desc">
      </el-table-column>

    </el-table>
  </div>
</template>
<script>
    export default {
        mixins: [window.mixin],
      methods: {
        tableRowClassName({row, rowIndex}) {
          console.log(row)
          if (rowIndex === 1) {
            return 'warning-row';
          } else if (rowIndex === 3) {
            return 'success-row';
          }
          return '';
        }
      },
        data() {
            return {
                "pageName": "大V股池",
              tableData: [{
                id: '12987122',
                name: '好滋好味鸡蛋仔',
                category: '江浙小吃、小吃零食',
                desc: '荷兰优质淡奶，奶香浓而不腻',
                address: '上海市普陀区真北路',
                shop: '王小虎夫妻店',
                shopId: '10333'
              }, {
                id: '12987123',
                name: '好滋好味鸡蛋仔',
                category: '江浙小吃、小吃零食',
                desc: '荷兰优质淡奶，奶香浓而不腻',
                address: '上海市普陀区真北路',
                shop: '王小虎夫妻店',
                shopId: '10333'
              }, {
                id: '12987125',
                name: '好滋好味鸡蛋仔',
                category: '江浙小吃、小吃零食',
                desc: '荷兰优质淡奶，奶香浓而不腻',
                address: '上海市普陀区真北路',
                shop: '王小虎夫妻店',
                shopId: '10333'
              }, {
                id: '12987126',
                name: '好滋好味鸡蛋仔',
                category: '江浙小吃、小吃零食',
                desc: '荷兰优质淡奶，奶香浓而不腻',
                address: '上海市普陀区真北路',
                shop: '王小虎夫妻店',
                shopId: '10333'
              }]
            }
        },
      filters: {
        toPercentage(value) {
          return (value * 100).toFixed(2) + '%';
        },
        toVolume(value) {
          return value.toLocaleString();
        }
      }
    }
</script>


<style lang="less">
    .el-table .warning-row {
      background: oldlace;
    }

    .el-table .success-row {
      background: #f0f9eb;
    }
    @import "../../assets/less/contact.less";
</style>